<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<meta charset="utf-8">
<meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no" name="viewport">
<meta content="yes" name="apple-mobile-web-app-capable">
<meta content="black" name="apple-mobile-web-app-status-bar-style">
<meta content="telephone=no" name="format-detection">
<meta content="email=no" name="format-detection">
<title>收款明细</title>
<link th:href="@{/ksdH5/css/public/mui/mui.css}" rel="stylesheet"/>
<script th:src="@{/ksdH5/js/public/mui/mui.min.js}"></script>
<script th:src="@{/ksdH5/js/public/jquery.min.js}"></script>
<script th:src="@{/ksdH5/js/public/public.js}"></script>
<link th:href="@{/ksdH5/css/smart/smartCont.css}" rel="stylesheet"/>
</head>
<body>
<div class="mui-content">
	<div class="headerBox">
		<a href="javascript:history.go(-1);" class="headerBox_left"><img th:src="@{/ksdH5/img/planList/fanhuiBnt.png}"></a>
		<span>收款明细</span>
	</div>
	<ul class="smartContBox" id="smar_list_ul">
		<li>
			<div class="smartContBox_top">
				<span>中国银行(0769) </span>
				<img th:src="@{/ksdH5/img/smartCont_fgx.png}" />
				<em>中国银行(0769) </em>
			</div>
			<div class="smartContBox_bottom">
				<div class="smartContBox_bottom_left">2018-11-22 09:28:18</div>
				<div class="smartContBox_bottom_right">
					<span>成功 1000元</span>
				</div>
			</div>
		</li>
		<li>
			<div class="smartContBox_top">
				<span>中国银行(0769) </span>
				<img th:src="@{/ksdH5/img/smartCont_fgx.png}" />
				<em>中国银行(0769) </em>
			</div>
			<div class="smartContBox_bottom">
				<div class="smartContBox_bottom_left">2018-11-22 09:28:18</div>
				<div class="smartContBox_bottom_right">
					<em>失败 1000元</em>
					<img class="smartContBox_bottom_right_tishi" th:src="@{/ksdH5/img/makePlan_wenhao.png}" />
				</div>
			</div>
		</li>
	</ul>
	<!--暂无数据-->
	<div class="smartContBox_noData" style="display: none;">
		<img th:src="@{/ksdH5/img/kjmx_zwsj.png}" />
		<p>您暂时还没有数据哦</p>
	</div>
</div>
</body>
<script type="text/javascript">
mui.init({
	swipeBack:true
})

/*失败提示语句*/
/* $(document).on('click',".smartContBox_bottom_right_tishi",function(){
	mui.alert('失败提示语句');
}); */
</script>
<script type="text/javascript" th:inline="javascript">
//获得项目根路径
var ctx = [[@{/}]];
var result= [[${result}]];
</script>
<script type="text/javascript">
//滚动条到底部加载更多
$(document).scroll(function(){
	if ($(document).scrollTop() >= $(document).height() - $(window).height()) {
        var shopIndex_box_listBox = new Array()
        for (a=0;a<20;a++){
        	shopIndex_box_listBox[a] = ''
        }
		for(i=0;i<shopIndex_box_listBox.length;i++){
			$(".smartContBox").append(shopIndex_box_listBox[i]);
		}
        
        /*$.ajax({
        	type:"post",
        	url:"",
        	async:true,
			dataType:"json",
			success:function(data){
				for (var i = 0; i < sum; i++) {   
	                result +=	''
	            }
				$('.palnCont_listBox').append(result);
			},
			error:function(){
				alert('数据有误');
			}
        }); */
	}
});

function alertError(errorMsg){
	mui.alert(errorMsg);
}


$(function(){
	var resultJson = JSON.parse(result);
	var listJson = JSON.parse(resultJson.ZNSKDetail);
	var str="";
	if(listJson.length>0){
		for(var i=0;i<listJson.length;i++){
			str += "<li>"
			str += "<div class='smartContBox_top'>";
			str += "<span>"+listJson[i].from+" </span>";
			str += "<img src='/ksdH5/img/smartCont_fgx.png' />";
			str += "<em>"+listJson[i].to+" </em>";
			str += "</div>";
			str += "<div class='smartContBox_bottom'>";
			str += "<div class='smartContBox_bottom_left'>"+listJson[i].time+"</div>";
			str += "<div class='smartContBox_bottom_right'>";
			if(listJson[i].status=="失败"){
				str += "<span>"+listJson[i].status+" "+listJson[i].money+"元";
				var errorMsg = listJson[i].error;
				if(errorMsg!=null){
					errorMsg =errorMsg.replace(/[\r\n]/g,"");//去掉错误信息中的换行
				}else {
					errorMsg ="";
				}
				str += '<img class="smartContBox_bottom_right_tishi" src="/ksdH5/img/makePlan_wenhao.png"  onclick="alertError(\''+errorMsg+'\')" />';
				str += "</span>";
			}else if(listJson[i].status=="成功") {
				str += "<span style='color:green'>"+listJson[i].status+" "+listJson[i].money+"元</span>";
			}else{
				str += "<em>"+listJson[i].status+" "+listJson[i].money+"元</em>";
			}
			str += "</div>";
			str += "</div>";
			str += "</li>";
		}
		$("#smar_list_ul").html(str);
	} else {
		$("#smar_list_ul").hide();
		$(".smartContBox_noData").show();
	}
	
})

//时间戳转时间日期
/* function timestampToTime(timestamp) {
        var date = new Date(timestamp);//时间戳为10位需*1000，时间戳为13位的话不需乘1000
       var Y = date.getFullYear() + '-';
       var M = (date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1) : date.getMonth()+1) + '-';
       var D = (date.getDate() < 10 ? '0'+date.getDate() : date.getDate()) + ' ';
       var h = (date.getHours() < 10 ? '0'+date.getHours() : date.getHours()) + ':';
       var m = (date.getMinutes() < 10 ? '0'+date.getMinutes() : date.getMinutes()) + ':';
       var s = (date.getSeconds() < 10 ? '0'+date.getSeconds() : date.getSeconds());
        return Y+M+D+h+m+s;
   } */
</script>
</html>
